package com.qzsoft.zhjd.machine.modules.machinereport.dto;

import java.math.BigDecimal;
import java.util.List;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;

/**
 * @ClassName MachineReportMaintenanceDto
 * @Description 设备维修保养
 * @author linhuawei
 * @since 2021-11-03
 */
@Data
@EqualsAndHashCode(callSuper = false)
@NoArgsConstructor
@AllArgsConstructor
@Builder
@ToString
public class DeptReportMaintenanceDto {

    /**
     * 机构主键
     */
    private String deptPkid;

    /**
     * 机构编码
     */
    private String deptId;

    /**
     * 机构名称
     */
    private String deptName;

    /**
     * 维修费用
     */
    private BigDecimal repairAmount;

    /**
     * 维修次数
     */
    private Integer repairCount;

    /**
     * 保养费用
     */
    private BigDecimal maintainAmount;

    /**
     * 保养次数
     */
    private Integer maintainCount;

    /**
     * 汇总费用
     */
    private BigDecimal amount;
    

    /**
     * 下级机构汇总信息
     */
    private List<DeptReportMaintenanceDto> list;
    
    public BigDecimal getAmount() {
        if(null == amount) {
            amount = repairAmount.add(maintainAmount);
        }
        return amount;
    }

}
